package com.imooc.ioc.demo1.common;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;


public class JsonUtil <T>{


    public  static ObjectMapper objectMapper = new ObjectMapper();


    public String generator(int status, T data) throws JsonProcessingException {

        String json = objectMapper.writeValueAsString(new ResModel<T>(status , data));

        System.out.println(json);

       return json ;
    }


}
